$(function() {
	getVerifyCode();
	var btnArray = ['朕知道了'];
	mui.confirm('请填写真实手机号以免影响兑奖', '通知', btnArray);
});

/**
 * 获取验证码
 */
function getVerifyCode() {
	Common.ajaxNoParamGet("/fenful/api/v1/common/getPicVerifyCode", function(res) {
		$("#verifyPic").attr("src", "http://"+window.location.host+"/fenful/res/ApiImgValidcode?code=" + res.picUrl);
		$("#uuid").val(res.uuid);
	});
}

/**
 * 注册领取
 */
function register() {
	var paramStr = {};
	paramStr.phoneNum = $("#phoneNum").val();
	paramStr.password = $("#password").val();
	paramStr.picVerifyCode = $("#verifyCode").val();
	paramStr.uuid = $("#uuid").val();
	paramStr.merchantId = "e3ead303d51b4b41a8653209800dadb4";
	paramStr.partnerId = Common.queryGetParam("partnerId");
	var params = {};
	params.paramStr = JSON.stringify(paramStr);
	Common.ajaxWithParam("/fenful/api/v1/login/picRegister", params, function(res) {
		var denomination = Common.queryGetParam("denomination")
		if(null == denomination || "undefined" == typeof(denomination) || "" == denomination) {
			window.location.href = "/fenful/h5/gyUnionLogin.html?phoneNum=" + $("#phoneNum").val();
		} else {
			window.location.href = "/fenful/h5/gyUnionLogin.html?phoneNum=" + $("#phoneNum").val() + "&denomination=" + denomination;
		}

	});

}

function oldUser() {
	var denomination = Common.queryGetParam("denomination")
	if(null == denomination || "undefined" == typeof(denomination) || "" == denomination) {
		window.location.href = "/fenful/h5/gyUnionLogin.html";
	} else {
		window.location.href = "/fenful/h5/gyUnionLogin.html?denomination=" + denomination;
	}
}